package com.mobilebsc.datamanager;

import java.util.List;

import com.mobilebsc.datatype.SignalAssociation;
import com.mobilebsc.exception.NotImplementedException;
import com.mobilebsc.httpclient.callback.IAsyncTaskCompleteListener;
import com.mobilebsc.httpclient.callback.SignalAssociationRestClientUsage;

public class SignalAssociationDataManager implements IDataManager<SignalAssociation>, IAsyncTaskCompleteListener<List<SignalAssociation>>  {

	private SignalAssociationRestClientUsage restClientUsage;
	private List<SignalAssociation> resultList;
	private List<SignalAssociation> singleResultList;
	private IDataReadyListener dataReadyListener;
	
	public SignalAssociationDataManager(IDataReadyListener dataReadyListener) {
		restClientUsage = new SignalAssociationRestClientUsage(this);
		resultList = null;
		singleResultList = null;
		this.dataReadyListener = dataReadyListener;
	}
	
	@Override
	public void onTaskComplete(List<SignalAssociation> result) {
		resultList = result;

		// do something with ws response
		dataReadyListener.dataReady();
		
	}

	@Override
	public void getAll() {
		throw new NotImplementedException();
		
	}

	@Override
	public void getById(int id) {
		throw new NotImplementedException();
		
	}

	@Override
	public List<SignalAssociation> loadAll() {
		throw new NotImplementedException();
	}

	@Override
	public List<SignalAssociation> loadById(int id) {
		throw new NotImplementedException();
	}

	@Override
	public void add(SignalAssociation element) {
		restClientUsage.add(element);
		
	}

	@Override
	public void delete(SignalAssociation element) {
		restClientUsage.delete(element);
		
	}	
}